1. Field of the Invention
This invention relates to object oriented runtime data area management systems and methods, and more particularly to Java™ automatic storage management systems and methods.
2. Description of Related Art
In object oriented software environments when an object instance is created, one or more sections of a runtime data area or memory are assigned for the instance's variables. When the object is complete (its variables are out of scope), the object's variables assigned data area is ideally released or cleaned. These released or cleaned data or memory areas may then be assigned to other object instance's variables. In the Java platform, an automatic storage management object, termed “garbage collector” is instantiated periodically or upon request.
The garbage collector instance attempts to clean the runtime data area by detecting objects instances that are “out of scope” and removing their associated variables from the runtime data area. Java objects may include a finalize method that must be invoked before an object instance is destroyed and its variables cleaned from memory (the runtime data area). The garbage collector instance creates a thread for the finalize method of such objects. In some cases an object's finalize method may require one or more external events to be completed before it ends. In these cases, the finalize method thread may “hang” waiting for these external event completions. The garage collection object instance then is hung while waiting for the finalize method thread to end. In the interim no runtime data area is cleansed although new object instances may continue to be created and assigned runtime data area segment(s). Eventually, insufficient runtime data area segment(s) (memory) may be available for assignment. Thus, a need exists for a method, system, and mechanism that prevent the garbage collection object instance hanging due to a hung finalize method thread.